function reset(settings) {
    var store = new Store("settings");
    chrome.extension.getBackgroundPage().reset();
    for (var name in settings.manifest) {
        var setting = settings.manifest[name];
        if (typeof setting.set === "function") {
            setting.set(store.get(setting.params.name));
        }
    }
}

window.addEvent("domready", function () {
    // Option 1: Use the manifest:
    new FancySettings.initWithManifest(function (settings) {
        settings.manifest.resetSettings.addEvent('action', function() {
          if (confirm("This will reset this extension's settings.  Are you sure?"))
            reset(settings);
        });
    });
});
